<!DOCTYPE html>
<html lang="en">
<head>
    <title>WSD Admin</title>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="stylesheet" href="__STATICURL__/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/bootstrap-responsive.min.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/uniform.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/select2.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/matrix-style.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/matrix-media.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/bootstrap-wysihtml5.css"/>
    <link href="__STATICURL__/font-awesome/css/font-awesome.css" rel="stylesheet"/>
</head>
<body>
<include file="Common:header"/>
<div id="content">
    <!--breadcrumbs-->
    <div id="content-header">
        <div id="breadcrumb"><a href="__ROOT__/clover"><i class="icon-home"></i> 主页</a><a href="#" class="current">首页Banner</a>
        </div>
    </div>
    <!--End-breadcrumbs-->
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <div class="widget-box" style="margin-top:0px;">
                    <div class="widget-title"><span class="icon"> <i class="icon-picture"></i> </span>
                        <h5>首页Banner</h5>
                    </div>
                    <div class="widget-content nopadding">
                        <ul class="recent-posts">
                            <li class="cp_photo_con">
                                <p><span id="J_morepic_upload"></span></p>
                            </li>
                        </ul>
                        <div class="widget-content">
                            <ul class="thumbnails picList">
                                <notempty name="banner_list">
                                    <foreach name="banner_list" item="row">
                                        <li class="span2 li_{$row.id}" style="width:170px;height:100px;">
                                            <div class="fl"><input class="J_sort_order" tyle="text" data-id="{$row.id}"
                                                                   value="{$row.sort_order}" style="width:20px;">
                                            </div>
                                            <a> <img src="__UPLOADURL__/{$row.banner_img}" alt=""> </a>

                                            <div class="actions">
                                                <a title="" data-id={$row.id} class="J_delete"
                                                   href="javascript:void(0);">
                                                    <i class="icon-remove"></i>
                                                </a>
                                                <a class="lightbox_trigger" href="__UPLOADURL__/{$row.banner_img}">
                                                    <i class="icon-search"></i>
                                                </a>
                                            </div>
                                        </li>
                                    </foreach>
                                </notempty>
                                <ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--Footer-part-->
<include file="Common:footer"/>
<!--end-Footer-part-->
<script src="__STATICURL__/js/jquery.min.js"></script>
<script src="__STATICURL__/js/jquery.ui.custom.js"></script>
<script src="__STATICURL__/js/bootstrap.min.js"></script>
<script src="__STATICURL__/js/jquery.uniform.js"></script>
<script src="__STATICURL__/js/select2.min.js"></script>
<script src="__STATICURL__/js/jquery.dataTables.min.js"></script>
<script src="__STATICURL__/js/matrix.js"></script>

<script src="__STATICURL__/js/swfupload.js"></script>
<script src="__STATICURL__/js/swfupload.queue.js"></script>
<script src="__STATICURL__/js/fileprogress.js"></script>
<script src="__STATICURL__/js/handlers.js"></script>
</body>
</html>
<script type="text/javascript">
    $(document).ready(function ($) {
        $(".J_sort_order").live("change", function () {
            var id = $(this).attr("data-id");
            var sort_order = $(this).val();
            if (isNaN(sort_order) == false) {
                $.post('__URL__/do_change_sort', {id: id, sort_order: sort_order}, function (res) {
                    if (res) {
                        window.location.href = "__URL__";
                    }
                });
            }
            // window.location.href = "__URL__/index/cat_id/"+cat_id;
        });
        $(".J_delete").live("click", function (event) {
            var id = $(this).attr("data-id");
            $.post('__URL__/do_delete', {id: id}, function (res) {
                if (res) {
                    $(".li_" + id).fadeOut("fast");
                }
            }, "json");
        });
        var settings = {
            flash_url: "__STATICURL__/js/swfupload.swf",
            upload_url: "__URL__/upload_cover",
            post_params: {"is_more": "yes"},
            file_size_limit: "100 MB",
            file_types: "*.jpg;*.gif;*.jpeg;*.png;",
            file_upload_limit: 100,
            file_queue_limit: 100,
            custom_settings: {
                progressTarget: "fsUploadProgress",
                cancelButtonId: "btnCancel"
            },
            debug: false,
            // Button settings
            button_width: "114",
            button_height: "32",
            button_placeholder_id: "J_morepic_upload",
            button_text_style: ".theFont { font-size: 16;}",
            button_cursor: -2,
            button_window_mode: "TRANSPARENT",
            button_action: -110,//-110多图片上传，-100但图片上传，-120文件上传
            button_image_url: "__STATICURL__/images/banner_upload_place.png",

            file_queued_handler: fileQueued,
            file_queue_error_handler: fileQueueError,
            file_dialog_complete_handler: fileDialogComplete,
            upload_start_handler: banner_uploadStart,
            upload_progress_handler: uploadProgress,
            upload_error_handler: uploadError,
            upload_success_handler: banner_upload_Success,
            upload_complete_handler: uploadComplete
        };
        swfu = new SWFUpload(settings);
    });
</script>
